#ifndef WAVEFORMTHREAD_H
#define WAVEFORMTHREAD_H
#include <QException>
#include <QThread>
#include <QDebug>
#include <QMetaType>
#include <QVector>
#include "bass.h"
/**
  Класс, расчитывающий координаты для WaveForm

 * @brief The WaveFormThread class
 */
class WaveFormThread : public QThread
{
    Q_OBJECT
public:

    bool live;
    enum Action {
        NOT,
        ADD,
        DEL,
    } action;
    QVector<HFX> effects;
    QString fileName;
    int WIDTH;
    QWORD BYTE_LENGTH;
    double TIME_LENGTH;
    HSTREAM decoder;
    DWORD bpp;			// bytes per pixel
    double *wavebufL = NULL;
    double *wavebufR = NULL;

    //parameters for addFX()
    DWORD type;
    const void* params;

    explicit WaveFormThread(QString fileName);
    ~WaveFormThread();
    void run();
    void create(QString fileName);
    void scanAudio();
    void rescan();
    void addLeftChannelGraph();
    void addRightChannelGraph();
    void addFX();
    void addFX(DWORD type, const void* params);
    void delEffects();
    void delFX();

signals:
    void leftData(QVector<double> dataX, QVector<double> dataY);
    void rightData(QVector<double> dataX, QVector<double> dataY);
    void addSlider();
    void clear();

public slots:
};

#endif // WAVEFORMTHREAD_H
